package org.fude.bootstrap.controller;

import org.springframework.validation.BindException;
import org.springframework.web.bind.annotation.ControllerAdvice;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.ResponseBody;

@ControllerAdvice
@ResponseBody
public class GlobalController {

	@ExceptionHandler(Exception.class)
	public String handler(Exception e) {
		System.out.println(e);
		return "exception";
	}
	@ExceptionHandler(BindException.class)
	public String handler(BindException e) {
		System.out.println(e);
		return "exception";
	}
}
